/****************************************************************
 * I am the AC 130 vs Pirate game. I allow the user to control an 
 * AC130 gunship in the hunt for Modern day pirates. The player  
 * will be allowed to roam free across a section of ocean/coastline.  
 * In the water there will be four types of vessels: Merchant  
 * ships that the player must protect, Pirate ships that the player  
 * must identify and destroy, Fishing boats that look like Pirate  
 * ships that the player must not destroy, and Friendly Navy ships  
 * that can capture pirates for extra points. Time permitting there  
 * may also be ground targets to attack. 
 *
 * Key elements of this project will be the Player/AC130, the Ships,  
 * the ShipAI system, the collision grid, the debris controller, the  
 * Ground/Water, Clouds, and scoring system. This project will make  
 * use of an external text file to store useful game parameters,  
 * thus allowing us to play balance the game without recompiling  
 * the executable. 
 *****************************************************************
 * I am the Base screen class. I provide a default template for a 
 * screen of the game. I have functions that recieve data from the 
 * ScreenCtrl class. I also have a pointer to the game data class
 * this will allow me to share data with other screens, as well as 
 * access game data information.
 *****************************************************************/

#include "baseScreen.h"
/// I am the constructor. I create all objcets native to this screen
BaseScreen::BaseScreen(){
	myScreenType = stGamePlay;
}
BaseScreen::~BaseScreen(){

}

// I am the initilization function. I accept the external GameData
// class and do the one time processing that requires a GameData 
// Pointer like load images from hash table paths. I am also
// responsible for passing the GameData pointer to this screen's
// internal components
void BaseScreen::Init(GameData *exGd){
	gd = exGd;
}

/// I am the screen start function. I run the processes that need to
/// be run after this screen gets control from another screen.
void BaseScreen::OnStart(){}

/// I am the screen close function. I run the processes that need to
/// be run before this screen passes control from another screen.
void BaseScreen::OnClose(){}

/// I am the mouse down event handeler. I get the mouse's position in
/// the screen as well as the button index that was pressed. 
void BaseScreen::OnMouseDn(int mouseX, int mouseY, int bt){
	// example code writes
	sprintf(gd->debugTxt, "Mouse button:%d down at X:%d, Y:%d",bt,mouseX,mouseY);
}

/// I am the mouse up event handeler. I get the mouse's position in
/// the screen as well as the button index that was pressed. 
void BaseScreen::OnMouseUp(int mouseX, int mouseY, int bt){}

/// I am the key down event handeler. I pass the allegro key code of 
/// the key that was pressed in the latest update cycle
void BaseScreen::OnKeyDn(int keyCode){
	sprintf(gd->debugTxt, "KeyDown Code:%d ", keyCode);
}

/// I am the key up event handeler. I pass the allegro key code of 
/// the key that was released in the latest update cycle
void BaseScreen::OnKeyUp(int keyCode){}

/// I am the update function. I get the screen coordinates of the mouse
/// on a regular basis. All positional/animation updates should get 
/// processed here 
void BaseScreen::Update(){

}

/// I am the draw function. I get the back buffer passed in as 
/// an argument. I draw this screen's data to the back buffer once
/// per update cycle
void BaseScreen::Draw(BITMAP * myScreen){
	clear_to_color(myScreen, makecol(0,0,0));

		// draw mouse pointer
	circlefill(myScreen, gd->mouseX, gd->mouseY, 5, makecol(255,0,0));
}



